using System;
using System.Collections.Generic;
using System.Text;

namespace GSN
{
    static class Utils
    {
        public static void processError(Exception ex)
        {
            processError(ex, false);
        }

        public static void processError(Exception ex, bool forceMsgBox)
        {
            Logger.logException(ex);
            if ((ex.Message.Length > 0 && !Logger.isOn()) || forceMsgBox)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message, "GSN Error",
                    System.Windows.Forms.MessageBoxButtons.OK,
                    System.Windows.Forms.MessageBoxIcon.Error);
            }
        }

        public static void launchHomepage()
        {
            try
            {
                System.Diagnostics.Process.Start("http://gsn.kipmi.com/?link");
            }
            catch (Exception ex)
            {
                processError(ex);
            }
        }
    }
}
